package com.hurr.common.dao;

import java.io.Serializable;
import java.util.List;

/**
 * This Interface is a template for Data Access Objects, every DAO
 * implementation should extends this inteface.
 * 
 * @author Fernando Perelli
 * @param <Entity>
 * @param <T>
 */
public interface GenericDao<Entity, T extends Serializable> {

	/**
	 * Save Method
	 * 
	 * @param entity
	 * @return {@link Entity}
	 */
	public Entity save(Entity entity);

	/**
	 * Update Method
	 * 
	 * @param entity
	 */
	public void update(Entity entity);

	/**
	 * Delete Method by Object
	 * 
	 * @param entity
	 */
	public void delete(Entity entity);

	/**
	 * Find By Id Method
	 * 
	 * @param id
	 * @return {@link Entity}
	 */
	public Entity findById(T id);

	/**
	 * Find All Method
	 * 
	 * @return {@link List<Entity>}
	 */
	public List<Entity> findAll();
}
